var appData = getApp().globalData;


Page({
  data: {
    sUrl: appData.sUrl,
    //isLogined: wx.getStorageSync('flag'),供登录使用
    bottonClr: [
      "white", "white", "white", "white", "white", "white", "white", "white", "white", "white"
    ],  
    setArr: [
      { id: "1", name: "学生信息", img: "option", margin: "0" },
      { id: "2", name: "签到", img: "medal", margin: "30" },
      { id: "3", name: "查成绩", img: "ticket", margin: "0" },
      { id: "4", name: "收藏", img: "favorite", margin: "30" },
      { id: "5", name: "问题反馈", img: "chat", margin: "40" },
    ],
  },

  tap: e => {
    var btnID = e.currentTarget.id
    switch (btnID) {
      case "0": wx.navigateTo({ url: '../../manage/login/login', }); break;
      case "1": wx.navigateTo({ url: '../info/info', }); break;
      case "2": wx.navigateTo({ url: '../sign/sign', }); break;
      case "3": 
        wx.request({
          url: 'http://118.25.179.118/YouE/conn.php',
          
          success(res){
            console.log(res)
          }
        })
        break;
      case "4": wx.navigateTo({ url: '../favorites/favorites', }); break;
      case "5": wx.navigateTo({ url: '../help/help', }); break;
    }
    
  },

//******************************************
  CA: function(e) {
    var btn = e.currentTarget.id
    this.setData({ [`bottonClr[${btn}]`]: "#ddd" })
  },

  CB: function (e) {
    var btn = e.currentTarget.id
    this.setData({ [`bottonClr[${btn}]`]: "white" })
  
    /*console.log('转入')*/
  },


  onShow:function(){
    
  },


  onShareAppMessage: function() {

  }
})